package com.baba.shop.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baba.shop.bean.brand.Brand;
import com.baba.shop.dao.brand.BrandDao;
import com.baba.shop.service.BrandService;
import com.baba.shop.utils.Page;

@Service
@Transactional
public class BrandServiceImpl implements BrandService {
	@Autowired
	BrandDao brandDao;

	@Override
	@Transactional(readOnly=true)
	public Page<Brand> getBrandList(Brand brand) {
		Page<Brand> page = new Page<>(brand.getPageNum(), 5, brandDao.getTotalSize(brand));
		page.setList(brandDao.getBrandListByPage(brand));
		return page;
	}

}
